package com.zx.mes.rabbitmq.hyl.controller;

import com.zx.mes.rabbitmq.hyl.fanout.FanoutSender;
import com.zx.mes.rabbitmq.hyl.hello.HelloProduce;
import com.zx.mes.rabbitmq.hyl.object.ObjectProduce;
import com.zx.mes.rabbitmq.hyl.topic.TopicSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * helloController
 * @author hyl
 * @date 2018-3-16
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private HelloProduce helloProduce;

    @Autowired
    private ObjectProduce objectProduce;

    @Autowired
    private TopicSender topicSender;

    @Autowired
    private FanoutSender fanoutSender;



    @RequestMapping("/say")
    public String hello(){
        helloProduce.send();
        return "";
    }

    @RequestMapping("/object")
    public String object(){
        objectProduce.send();
        return "";
    }

    @RequestMapping("/topic")
    public String topic(){
        topicSender.send();
        topicSender.send1();
        topicSender.send2();
        return "";
    }

    @RequestMapping("/fanout")
    public String fanout(){
        fanoutSender.send();
        return "";
    }
}
